/*
 * LinuxX11OS.h
 *
 *  Created on: 17.02.2011
 *      Author: dis
 */

#ifndef LINUXX11OS_H_
#define LINUXX11OS_H_

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include "AbstractOS.h"

class LinuxX11OS: public AbstractOS {
private:
	Display *display;
	Atom NET_ACTIVE_WINDOW;
	Atom NET_WM_PID;
	Atom WM_ICON_NAME;
	Atom WM_CLASS;
	Activity* current;
	void* property(Window win, Atom prop, Atom type, int *nitems);
	bool propertyText(Window window, Atom prop, char* buffer, int size);
	void setCurrent(Activity* newCurrent);
public:
	LinuxX11OS();
	virtual ~LinuxX11OS();
	Activity* getActivity();
	Activity* getCurrent() {
		return current;
	}
	bool init();
	void clean();
};

#endif /* LINUXX11OS_H_ */
